﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using Garlic.BLL.Common;
using DAL.SystemManagement;
using Garlic.DM.DataModel;

namespace BLL.SystemManagement
{
    public class FlightInfoBLL : BaseManager
    {
        public static DataTable GetShipAgency(int user_id)
        {
            return FlightInfoDAL.GetShipAgency(user_id);
        }

        public static DataTable GetFlt_schdulDataTable(int flt_sln_id)
        {
            return FlightInfoDAL.GetFlt_schdulDataTable(flt_sln_id);
        }

        /// <summary>
        /// 选择服务航线，班期得到预分码头。
        /// </summary>
        /// <param name="flt_sln_id"></param>
        /// <param name="flt_id"></param>
        /// <returns></returns>
        public static DataTable GetFlt_schdulDataTable(int flt_sln_id,int flt_id)
        {
            return FlightInfoDAL.GetFlt_schdulDataTable(flt_sln_id, flt_id);
        }

        public static DataTable GetFlt_TerminalDataTable()
        {
            return FlightInfoDAL.GetFlt_TerminalDataTable();
        }


        /// <summary>
        /// 根据服务航线和代理公司获取班期和航班ID
        /// </summary>
        /// <param name="agentID"></param>
        /// <param name="flt_sln_id"></param>
        /// <returns></returns>
        public static DataTable GetFlightScheduleBySln(int? agentID, string flt_sln_id)
        {
            return FlightInfoDAL.GetFlightScheduleBySln(agentID, flt_sln_id);

        }

        public static DataTable GetSt_flightsDataTable(int? agentID, string flt_sln_id, string flt_ter_cst_id)
        {
            return FlightInfoDAL.GetSt_flightsDataTable( agentID, flt_sln_id, flt_ter_cst_id);
        }

        public static int UpdateSt_flights(int flt_id,  string flt_cycle,
            string flt_initdt, string flt_dockhour, string flt_iamount, string flt_eamount,string user)
        {
            return FlightInfoDAL.Update_St_flights(flt_id,flt_cycle, flt_initdt,
                flt_dockhour, flt_iamount, flt_eamount,user);
        }

        public static int Insert_St_flights( string flt_sln_id,string FLT_TER_CST_ID, string flt_schdul, string flt_cycle,
            string flt_initdt, string flt_dockhour, string flt_iamount, string flt_eamount, string user)
        {
            return FlightInfoDAL.Insert_St_flights(  flt_sln_id, FLT_TER_CST_ID,  flt_schdul,  
                flt_cycle,  flt_initdt,  flt_dockhour,  flt_iamount,  flt_eamount,user);
        }

        public static int Delete_St_flights(int flt_id)
        {
            return FlightInfoDAL.Delete_St_flights(flt_id);
        }


        /// <summary>
        /// 根据服务航线获取预分码头
        /// </summary>
        /// <param name="sln_ID">服务航线ID</param>
        /// <returns></returns>
        public static DataTable Get_CST_NameBySLN(string sln_ID, string ageID)
        {
            return FlightInfoDAL.Get_CST_NameBySLN(sln_ID, ageID);
        }



        /// <summary>
        /// 获取班期配置表
        /// </summary>
        /// <returns></returns>
        public static DataTable GetFLT_SCHDUL()
        {
            return FlightInfoDAL.GetFLT_SCHDUL();
        }





        #region new add


        FlightInfoDAL dal = new FlightInfoDAL();
        /// <summary>
        /// 获取web_vm_flights的所有信息
        /// </summary>
        /// <param name="strWhere"></param>
        /// <param name="strOrder"></param>
        /// <returns></returns>
        public DataTable GetTable(string strWhere, string strOrder)
        {

          return   dal.GetTable(strWhere, strOrder);
        }


        /// <summary>
        /// 执行添加、修改、删除操作
        /// </summary>
        /// <param name="operationType"></param>
        /// <param name="userID"></param>
        /// <param name="model"></param>
        /// <returns></returns>
        public string InsertUpdateDeleteOperation(int operationType, int userID, WEB_VM_FLIGHTS model)
        {

            return dal.InsertUpdateDeleteOperation(operationType, userID, model);
        }

       

        #endregion





    }
}
